#!/usr/bin/env python
# -*- coding: utf-8 -*-

__author__ = 'zhao jiang'

'''
A WSGI application entry.
'''

import logging; logging.basicConfig(level=logging.INFO)
import os
import sys
sys.path.append("C:\\Users\\95\\Desktop\\work\\bigdate\\www\\config")
sys.path.append("C:\\Users\\95\\Desktop\\work\\bigdate\\www\\transwarp")
sys.path.append("C:\\Users\\95\\Desktop\\work\\bigdate\\www")
from config_default import configs
import db
from web import WSGIApplication, Jinja2TemplateEngine

# init db:
db.create_engine(**configs['db'])
# init wsgi app:
wsgi = WSGIApplication(os.path.dirname(os.path.abspath(__file__)))
print os.path.dirname(os.path.abspath(__file__))
template_engine = Jinja2TemplateEngine(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates'))
print os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates')
wsgi.template_engine = template_engine
import urls

print wsgi.add_module(urls)

if __name__ == '__main__':
	wsgi.run(8800)
